<template>
    <div class="center">
        <vue-core-image-upload :class="['pure-button','pure-button-primary','js-btn-crop']" text='图片裁剪' crop="local" inputOfFile='file' cropRatio="auto" @imageuploaded="imageuploaded" :data="data" :type="0" compress="100" :max-file-size="5242880" :url="location">
        </vue-core-image-upload>
        <img :src="src" alt="">
    </div>
</template>

<script>
import { location } from '../utils/local.js'
// import VueCoreImageUpload from 'vue-core-image-upload'

export default {

    data() {
        return {
            location: location,
            data: { file_type: 0 },
            src: 'http://img1.vued.vanthink.cn/vued0a233185b6027244f9d43e653227439a.png',
        }
    },
    methods: {
        imageuploaded(res) {
            if (res.status == 0) {
                this.src = res.data.src;
            }
        },
        imagechanged(res) {
            console.log('图片改变', res)
        }
    }
};
</script>